/**
 * @(#)UserServiceImpl.java, 2017/12/16.
 * <p/>
 * Copyright 2017 Wangzx, Inc. All rights reserved.
 * WANGZX/CONFIDENTIAL. Use is subject to license terms.
 */
package org.wangzx.exercise.service.core.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.wangzx.exercise.dao.UserDao;
import org.wangzx.exercise.meta.bean.UserBean;
import org.wangzx.exercise.meta.convertor.CommonConvertor;
import org.wangzx.exercise.meta.po.User;
import org.wangzx.exercise.service.core.UserCoreService;

@Service("userCoreService")
public class UserCoreServiceImpl implements UserCoreService {
    private static final Logger logger = LoggerFactory.getLogger(UserCoreServiceImpl.class);

    @Autowired
    private UserDao userDao;

    @Override
    public UserBean getByName(String name) {
        logger.info("[op:getByName] get user by name. name={}", name);
        User user = userDao.getByName(name);
        return CommonConvertor.poToBo(user, UserBean.class);
    }
}
